package com.example.lxj.sources.service.impl;

import java.util.List;

import cn.hutool.core.date.DateUtil;
import com.example.lxj.sources.entity.TbDevice;
import org.apache.tika.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.lxj.sources.mapper.TbDeviceMapper;
import com.example.lxj.sources.service.ITbDeviceService;

/**
 * 鉴定设备Service业务层处理
 * 
 * @author lxj
 * @date 2024-10-15
 */
@Service
public class TbDeviceServiceImpl implements ITbDeviceService 
{
    @Autowired
    private TbDeviceMapper tbDeviceMapper;

    /**
     * 查询鉴定设备
     * 
     * @param id 鉴定设备主键
     * @return 鉴定设备
     */
    @Override
    public TbDevice selectTbDeviceById(Long id)
    {
        return tbDeviceMapper.selectTbDeviceById(id);
    }

    /**
     * 查询鉴定设备列表
     * 
     * @param tbDevice 鉴定设备
     * @return 鉴定设备
     */
    @Override
    public List<TbDevice> selectTbDeviceList(TbDevice tbDevice)
    {
        return tbDeviceMapper.selectTbDeviceList(tbDevice);
    }

    /**
     * 新增鉴定设备
     * 
     * @param tbDevice 鉴定设备
     * @return 结果
     */
    @Override
    public int insertTbDevice(TbDevice tbDevice)
    {
        tbDevice.setCreateTime(DateUtil.date());
        return tbDeviceMapper.insertTbDevice(tbDevice);
    }

    /**
     * 修改鉴定设备
     * 
     * @param tbDevice 鉴定设备
     * @return 结果
     */
    @Override
    public int updateTbDevice(TbDevice tbDevice)
    {
        tbDevice.setUpdateTime(DateUtil.date());
        return tbDeviceMapper.updateTbDevice(tbDevice);
    }

    /**
     * 批量删除鉴定设备
     * 
     * @param ids 需要删除的鉴定设备主键
     * @return 结果
     */
    @Override
    public int deleteTbDeviceByIds(Long[] ids)
    {
        return tbDeviceMapper.deleteTbDeviceByIds(ids);
    }

    /**
     * 删除鉴定设备信息
     * 
     * @param id 鉴定设备主键
     * @return 结果
     */
    @Override
    public int deleteTbDeviceById(Long id)
    {
        return tbDeviceMapper.deleteTbDeviceById(id);
    }
}
